SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.[DnnProduct_PWSyncDashBoard_DeleteDBSyncStats]
	@DeletionList NVARCHAR(1000)
AS
BEGIN
	
	DECLARE @sql NVARCHAR(MAX)
	
	SET @sql = 'DELETE FROM DnnProduct_PWSyncDashBoard_LastSyncStatuses WHERE (1 = 1)'
	IF (LEN(@DeletionList) > 0)
		BEGIN
			SET @sql = @sql + ' AND ([DBName] IN (' + @DeletionList + '))'
		END
		
	EXECUTE sp_executesql @sql
	
	SELECT @@ROWCOUNT
	
END
GO
